package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.region.vo.RegionVo;
import com.cskaoyan.service.RegionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author wangdezhao
 * @date 2021/6/4
 * @description
 */
@RestController
@RequestMapping("admin")
public class AdminRegionController {
    @Autowired
    RegionService regionService;

    @RequestMapping("region/list")
    public BaseRespVo list(){
        List<RegionVo> regionVoList = regionService.selectAllRegions();
        System.out.println(regionVoList.size());
        return BaseRespVo.ok(regionVoList);
    }

}
